import React from 'react';

class ListBody extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    let list=this.props.items.map(function(item, index){
      let status;
      if(item.status==1){
        status=<button>修改</button>
      }else{
          status=<button>删除</button>
      }

          return (<tr key={item.id}>
            <td key={item.data || index}>{item["id" || index]}</td>
            <td key={item.name || index}>{item["name" || index]}</td>
            <td key={item.gender || index}>{item["gender" || index]}</td>
            <td key={item.age || index}>{item["age" || index]}</td>
            <td>{status}</td>
  
              </tr>);
        })
    return (
      <tbody>
        {list}
      </tbody>
    );
  }
};

export default ListBody;
